package com.briup.estore.web.servlet;

import com.briup.estore.common.result.Result;
import com.briup.estore.common.utils.JsonUtils;
import com.briup.estore.common.vo.OrderDetailVO;
import com.briup.estore.service.OrderService;
import com.briup.estore.service.impl.OrderServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author briup-adam
 * @Date 2023/8/4 下午3:28
 * @Description 获取订单详情
 **/
@WebServlet("/order/detail")
public class OrderDetailServlet extends  BaseServlet {
    private OrderService orderService=new OrderServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String orderId = req.getParameter("id");
        OrderDetailVO vo = orderService.getOrderById(orderId);
        writeData(resp, Result.success(vo));
    }
}
